class WriteoffVo {

  WriteoffData? data;

  WriteoffVo({this.data});

  WriteoffVo.fromJson(Map<String, dynamic> json) {
    data = json['data'] != null ? new WriteoffData.fromJson(json['data']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data'] = this.data!.toJson();
    }
    return data;
  }
}

class WriteoffData {
  int? id;
  int? pickType;
  String? orderSn;
  int? status;
  String? statusStr;
  int? isCheck;
  int? paymentType;
  int? payStatus;
  String? paidAmount;
  String? payableAmount;
  String? totalAmount;
  int? integral;
  String? companyTitle;
  String? trackingNumber;
  String? companyCode;
  String? createdAt;
  int? remainingTime;
  int? isBooking;
  String? voucherCode;
  int? storeId;
  String? pickingAt;
  String? transferedAt;
  int? receiverId;
  List<Products>? products;
  Store? store;
  Lottery? lottery;

  WriteoffData(
      {this.id,
      this.pickType,
      this.orderSn,
      this.status,
      this.statusStr,
      this.isCheck,
      this.paymentType,
      this.payStatus,
      this.paidAmount,
      this.payableAmount,
      this.totalAmount,
      this.integral,
      this.companyTitle,
      this.trackingNumber,
      this.companyCode,
      this.createdAt,
      this.remainingTime,
      this.isBooking,
      this.voucherCode,
      this.storeId,
      this.pickingAt,
      this.transferedAt,
      this.receiverId,
      this.products,
      this.store,
      this.lottery});

  WriteoffData.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    pickType = json['pick_type'];
    orderSn = json['order_sn'];
    status = json['status'];
    statusStr = json['status_str'];
    isCheck = json['is_check'];
    paymentType = json['payment_type'];
    payStatus = json['pay_status'];
    paidAmount = json['paid_amount'];
    payableAmount = json['payable_amount'];
    totalAmount = json['total_amount'];
    integral = json['integral'];
    companyTitle = json['company_title'];
    trackingNumber = json['tracking_number'];
    companyCode = json['company_code'];
    createdAt = json['created_at'];
    remainingTime = json['remaining_time'];
    isBooking = json['is_booking'];
    voucherCode = json['voucher_code'];
    storeId = json['store_id'];
    pickingAt = json['picking_at'];
    transferedAt = json['transfered_at'];
    receiverId = json['receiver_id'];
    if (json['products'] != null) {
      products = <Products>[];
      json['products'].forEach((v) {
        products!.add(new Products.fromJson(v));
      });
    }
    store = json['store'] != null ? new Store.fromJson(json['store']) : null;
    lottery = json['lottery'] != null ? new Lottery.fromJson(json['lottery']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['pick_type'] = this.pickType;
    data['order_sn'] = this.orderSn;
    data['status'] = this.status;
    data['status_str'] = this.statusStr;
    data['is_check'] = this.isCheck;
    data['payment_type'] = this.paymentType;
    data['pay_status'] = this.payStatus;
    data['paid_amount'] = this.paidAmount;
    data['payable_amount'] = this.payableAmount;
    data['total_amount'] = this.totalAmount;
    data['integral'] = this.integral;
    data['company_title'] = this.companyTitle;
    data['tracking_number'] = this.trackingNumber;
    data['company_code'] = this.companyCode;
    data['created_at'] = this.createdAt;
    data['remaining_time'] = this.remainingTime;
    data['is_booking'] = this.isBooking;
    data['voucher_code'] = this.voucherCode;
    data['store_id'] = this.storeId;
    data['picking_at'] = this.pickingAt;
    data['transfered_at'] = this.transferedAt;
    data['receiver_id'] = this.receiverId;
    if (this.products != null) {
      data['products'] = this.products!.map((v) => v.toJson()).toList();
    }
    if (this.store != null) {
      data['store'] = this.store!.toJson();
    }
    if (this.lottery != null) {
      data['lottery'] = this.lottery!.toJson();
    }
    return data;
  }
}

class Products {
  int? productId;
  String? title;
  String? image;
  String? price;
  int? quantity;
  int? skuId;
  String? specIds;
  String? specStr;

  Products(
      {this.productId,
      this.title,
      this.image,
      this.price,
      this.quantity,
      this.skuId,
      this.specIds,
      this.specStr});

  Products.fromJson(Map<String, dynamic> json) {
    productId = json['product_id'];
    title = json['title'];
    image = json['image'];
    price = json['price'];
    quantity = json['quantity'];
    skuId = json['sku_id'];
    specIds = json['spec_ids'];
    specStr = json['spec_str'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['product_id'] = this.productId;
    data['title'] = this.title;
    data['image'] = this.image;
    data['price'] = this.price;
    data['quantity'] = this.quantity;
    data['sku_id'] = this.skuId;
    data['spec_ids'] = this.specIds;
    data['spec_str'] = this.specStr;
    return data;
  }
}

class Store {
  int? id;
  String? address;
  String? title;
  int? quato;

  Store({this.id, this.address, this.title, this.quato});

  Store.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    address = json['address'];
    title = json['title'];
    quato = json['quato'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['address'] = this.address;
    data['title'] = this.title;
    data['quato'] = this.quato;
    return data;
  }
}

class Lottery {
  int? packageId;
  int? productId;
  int? status;
  Product? product;

  Lottery({this.packageId, this.productId, this.status, this.product});

  Lottery.fromJson(Map<String, dynamic> json) {
    packageId = json['package_id'];
    productId = json['product_id'];
    status = json['status'];
    product =
        json['product'] != null ? new Product.fromJson(json['product']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['package_id'] = this.packageId;
    data['product_id'] = this.productId;
    data['status'] = this.status;
    if (this.product != null) {
      data['product'] = this.product!.toJson();
    }
    return data;
  }
}

class Product {
  String? image;
  String? title;
  int? type;

  Product({this.image, this.title, this.type});

  Product.fromJson(Map<String, dynamic> json) {
    image = json['image'];
    title = json['title'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['image'] = this.image;
    data['title'] = this.title;
    data['type'] = this.type;
    return data;
  }
}
